using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using WebMVC.Models;

namespace WebMVC.Controllers
{
    public abstract class ProductControllerBase : ControllerBase
    {

        /*public ActionResult ThumbImage(long pid, string typ)
        {
            Stream imageStream = (new FileStoreService()).GetThumbImageStream(pid, typ);
            return new FileStreamResult(imageStream, System.Net.Mime.MediaTypeNames.Image.Jpeg);
        }

        public ActionResult PreviewImage(long pid, string typ)
        {
            Stream imageStream = (new FileStoreService()).GetPreviewImageStream(pid, typ);
            return new FileStreamResult(imageStream, System.Net.Mime.MediaTypeNames.Image.Jpeg);
        }

        public ActionResult EditImage(long pid, string typ)
        {
            Stream imageStream = (new FileStoreService()).GetEditImageStream(pid, typ);
            return new FileStreamResult(imageStream, System.Net.Mime.MediaTypeNames.Image.Jpeg);
        }

        public ActionResult LayoutImage(int id, string typ)
        {
            Stream imageStream = (new FileStoreService()).GetLayoutImageStream(id, typ);
            return new FileStreamResult(imageStream, System.Net.Mime.MediaTypeNames.Image.Gif);
        }*/

        protected ShoppingCart ShoppingCart{
            get
            {
                if (Session["shoppingCart"] == null)
                {
                    Session["shoppingCart"] = new ShoppingCart();
                }
                return (ShoppingCart)Session["shoppingCart"];
            }
        }


        
    }
}
